<!DOCTYPE html>
<html>
<head>
  <title>Webkot</title>
  <%= stylesheet_link_tag    "application", :media => "all" %>
  <%= javascript_include_tag "application" %>
	<%= javascript_include_tag :defaults %>
	<%= javascript_include_tag 'rails' %>
  <%= csrf_meta_tags %>
</head>
<body>
  <section id="top-bar">
		<% if user_signed_in? %>
    	<div class="wrap">
				<nav id="menu">
    			<ul>
      			<li>
        			<%= link_to "Blog", posts_path %>
      			</li>
						<li>
        			FTP
      			</li>
						<li>
        			Upload films
      			</li>
      			<li>
        			 <%= link_to('Log out', destroy_user_session_path, :method => :delete) %>
      			</li>
    			</ul>
  			</nav>
			</div>
		<% else %>
			<div id="sign-in">
				<div class="wrap">
        	<%= form_for("user", :url => user_session_path) do |f| %>
          	<div class="fields">
            	<%= f.email_field :email, :placeholder => 'exemple@mail.com' %>
            	<%= f.password_field :password, :placeholder => 'password' %>
            	<%= f.check_box :remember_me %>
            	<%= f.label :remember_me %>
          	</div>

          	<div class="form-actions">
            	<span class="button"><%= f.submit 'log in' %></span>
            	<%= link_to 'mot de passe oublié?', new_password_path('user') %>
							<%= link_to 'pas encore inscrit?', new_user_registration_path %>
						</div>
						<% end %>
					</div>
				</div>
			<% end %>
	</section>
<header>
   <div class="wrap">
     <h1 class="logo">
       <%= link_to "WebKot", root_url %>
     </h1>
     <p class="tagline">Share your stuffs</p>

     <section id="flash">
       <% if notice %>
         <div class="message notice"><%= notice %></div>
       <% end %>

       <% if alert %>
         <div class="message alert"><%= alert %></div>
       <% end %>
     </section>
   </div>
 </header>
  <section id="content">
		<section id="stream">
			<% if current_user.nil? %>
				<%= render :partial => "_shared/login" %>
			<% else %>
				<%= render :partial => "_shared/profile", :locals => {:user => current_user} %>
			<% end %>
		  <div id="stream-wrap">

<%= yield %>
	</div>
	</section>
</section>
</body>
</html>
